#pragma once

#include "poly_container.h"

#include <random>

namespace congruent_packing
{

template<class Container>
struct nesting_problem_t
{
	Container container;
	Solution points;

	void generate_random_solution( size_t num_points )
	{
		points.resize( num_points );
		double R = 0.0;

		std::uniform_real_distribution<> real_distr;
		std::default_random_engine rand_engine;
		
		do
		{
			for (size_t i = 0; i < num_points; i++)
			{
				points[i].x = real_distr(rand_engine);
				points[i].y = real_distr(rand_engine);
				container.clamp_point(points[i]);
			}
			R = Mathematica::minDistance(points);
		}
		while (R == 0.0);
	}
};

}